package Simple5;

import java.util.*;

public class FriendCircles {

	public static int findCircles(boolean[][] grid){
		
		HashMap<Integer, Integer> circleMap = new HashMap<Integer, Integer>();
		
		int n = grid.length;
		for(int i=0;i<n;++i){
			for(int j=0;j<i;++j){
				
			}	
		}
		
		
		
		
		
		return 0;
	}
	
	
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		in.nextLine();
		
		boolean[][] grid = new boolean[n][n];
		
		for(int i=0; i < n; ++i){
			String cur = in.nextLine();
			for (int j=0; j < n; ++j){
				grid[i][j] = cur.charAt(j) == 'Y' ? true : false;
			}
		}
		
		in.close();
		System.out.println(findCircles(grid));
	}

}
